class Shape:
    def __init__(self, canvas, shape_tag, color = 0):
        self.basic_list = []
        self.txt_list = []
        self.canvas = canvas
        self.shape_tag = shape_tag
        self.color_list = ['', 'red', 'yellow', 'blue', 'green']
        self.color = color

    def addBasic(self, basic):
        self.basic_list.append(basic)

    def moveShape(self, event, first_x, first_y):
        for basic in self.basic_list:
            basic.moveBasic(event, self.canvas, first_x, first_y)

    def addTxt(self, txt):
        self.txt_list.append(txt)

    def getTxt(self):
        return self.txt_list

    def mergeShape(self, shape):
        print(shape.basic_list)
        print(self.basic_list)
        for basic in shape.basic_list:
            print(basic)
            self.basic_list.append(basic)
        for txt in shape.txt_list:
            print(txt)
            self.txt_list.append(txt)
        print(self.basic_list)

    def createShape(self):
        for basic in self.basic_list:
            print(self.color_list[self.color % 5])
            basic.createBasic(self.canvas, self.color_list[self.color % 5])

    def changeColor(self):
        self.color += 1
        # print(self.color_list[self.color % 5])
        for basic in self.basic_list:
            basic.changeColor(self.color_list[self.color % 5], self.canvas)

    def largenShape(self):
        for basic in self.basic_list:
            basic.largenBasic(self.canvas)

    def lessenShape(self):
        for basic in self.basic_list:
            basic.lessenBasic(self.canvas)

